]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot: Don't use meta_window_get_rect
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 27 May 2014 19:10:28 +0000 (15:10 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 27 May 2014 19:14:33 +0000 (15:14 -0400)
It's going to be removed soon.

src/shell-screenshot.c

index a076aaabc3164eb3f8cb52aa38f9e25ef9470481..02d4e1503b5ffa9db7e146912ee4397e58fb9c72 100644 (file)
@@ -530,26 +530,15 @@ shell_screenshot_screenshot_window (ShellScreenshot *screenshot,
   window_actor = CLUTTER_ACTOR (meta_window_get_compositor_private (window));
   clutter_actor_get_position (window_actor, &actor_x, &actor_y);
 
-  if (include_frame || !meta_window_get_frame (window))
-    {
-      meta_window_get_outer_rect (window, &rect);
+  meta_window_get_frame_rect (window, &rect);
 
-      screenshot_data->screenshot_area.x = rect.x;
-      screenshot_data->screenshot_area.y = rect.y;
+  if (!include_frame)
+    meta_window_frame_rect_to_client_rect (window, &rect, &rect);
 
-      clip.x = rect.x - (gint) actor_x;
-      clip.y = rect.y - (gint) actor_y;
-    }
-  else
-    {
-      rect = *meta_window_get_rect (window);
-
-      screenshot_data->screenshot_area.x = (gint) actor_x + rect.x;
-      screenshot_data->screenshot_area.y = (gint) actor_y + rect.y;
-
-      clip.x = rect.x;
-      clip.y = rect.y;
-    }
+  screenshot_data->screenshot_area.x = rect.x;
+  screenshot_data->screenshot_area.y = rect.y;
+  clip.x = rect.x - (gint) actor_x;
+  clip.y = rect.y - (gint) actor_y;
 
   clip.width = screenshot_data->screenshot_area.width = rect.width;
   clip.height = screenshot_data->screenshot_area.height = rect.height;